<template>
    <div class="layout">
        <!-- 顶部标签 -->
        <app-header class="head">
            <template v-slot:head-title>
                <span>我的</span>
            </template>
        </app-header>

        <!-- 主要内容 -->
        <div class="main">
            <div class="user-top">
                <div class="user-avatar">
                    <img src="../assets/user/personal.png" alt="">
                </div>
                <div class="user-name">{{user}}</div>
            </div>
            <div class="user-info">
                <div class="resume">
                    <span>个人简介</span>
                    <p>我是傻逼</p>
                </div>
                <div class="detail">
                    <div class="frd">
                        <span>好友</span>
                        <span>31</span>
                    </div>
                    <div class="flo">
                        <span>关注者</span>
                        <span>121</span>
                    </div>
                    <div class="acm">
                        <span>玩家分数</span>
                        <span>50142</span>
                    </div>
                    <div class="adr">
                        <span>位置</span>
                        <span>EARTH</span>
                    </div>
                </div>
            </div>
            <div class="signout" @click="signout">注销</div>
        </div>

    </div>
</template>

<script>
import appHeader from '@/components/app-header.vue'

export default {
    name: "Follow",
    components: {
        appHeader
    },
    data() {
        return {
            user: ""
        }
    },
    methods: {
        signout() {
            localStorage.removeItem('userInfo')
            this.$router.push({path:'/login'})
        }
    },
    created() {
        this.user = localStorage.getItem('userInfo');
    }
}
</script>

<style lang="scss" scoped>
.layout {
    width: 100%;
    background-color: #171717;
    overflow: hidden;
    .main {
        width: 100%;
        height: 710px;
        margin-top: 80px;
        .user-top {
            height: 320px;
            padding-top: 80px;
            box-sizing: border-box;
            display: flex;
            position: relative;
            z-index: 1;
            &::before {
                content: "";
                width: 100%;
                height: 100%;
                background-image: url(../assets/user/personal.png);
                background-position: center;
                background-size: cover;
                filter: blur(10px);
                position: absolute;
                top: 0;
                left: 0;
                z-index: -1;
            }
            .user-avatar {
                width: 100px;
                height: 100px;
                border-radius: 50%;
                overflow: hidden;
                margin-left: 30px;
                img {
                    width: 100%;
                }
            }
            .user-name {
                margin-top: 30px;
                margin-left: 20px;
                font-size: 23px;
                color: white;
            }
        }
        .user-info {
            width: 100%;
            padding: 0 15px;
            box-sizing: border-box;
            color: white;
            z-index: 10;
            position: absolute;
            top: 45%;
            .resume {
                overflow: hidden;
                span {
                    font-size: 20px;
                }
                p {
                    margin-top: 15px;
                    height: 80px;
                }
            }
            .detail {
                display: flex;
                flex-wrap: wrap;
                div {
                    width: 50%;
                    height: 50px;
                    flex-shrink: 0;
                    margin-bottom: 20px;
                    span {
                        display: block;
                        &:first-child {
                            font-size: 20px;
                        }
                        &:last-child {
                            margin-top: 10px;
                        }
                    }
                }
            }
        }
        .signout {
            width: 80px;
            height: 45px;
            line-height: 45px;
            text-align: center;
            border: 3px solid white;
            color: white;
            position: absolute;
            bottom: 28px;
            left: 15px;
        }
    }
    footer {
        width: 100%;
        height: 160px;
        padding-top: 30px;
        box-sizing: border-box;
        .foot {
            height: 50px;
            line-height: 50px;
            background-color: black;
            color: #999;
            display: flex;
            justify-content: center;
            align-items: baseline;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
    }
}
</style>
